[add] api page and guide section on adding custom formulas #50
Open
mafanya23 wants to merge 4 commits into
Open
[add] api page and guide section on adding custom formulas #50mafanya23 wants to merge 4 commits into
mafanya23 wants to merge 4 commits into
Conversation
- expand arrow function to block body with explicit return - rename parameter from arg to value for clarity
Sorokin-Oleg
requested changes
May 13, 2026
| ### Usage | ||
|
|
||
| ~~~jsx | ||
| addFormula(name: string, handler: (...args: any[]) => any): void; |
There was a problem hiding this comment.
@mafanya23 забываем про any :))
/**
* Adds a custom mathematical formula to the internal library.
* @param name - The identifier of the formula.
* @param handler - A callback function that processes the input arguments
* (strings, numbers, booleans, or arrays of these) and returns a single value.
*/
addFormula: (name: string, handler: mathFunction) => void;type cellValue = string | number | boolean
type mathArgument = cellValue | cellValue[];
type mathFunction = (...x: mathArgument[]) => cellValue;| ### Parameters | ||
|
|
||
| - `name` - (*string*) required, the formula name (case-insensitive, stored as uppercase) | ||
| - `handler` - (*(...args: any[]) => any*) required, the function that computes the formula result. Receives the resolved cell values as arguments |
- replaced generic handler type with named type aliases (cellValue, mathArgument, mathFunction) - updated handler parameter description for clarity - fixed code comment capitalization to match project style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.